Changed enumerate_adapters to be able to work with custom backends#8230
Changed enumerate_adapters to be able to work with custom backends#8230Wumpf merged 10 commits intogfx-rs:trunkfrom
Conversation
|
As I already said in on matrix, I think it would be good to export enumerate_adapters everywhere and make it return just one adapter on the web. But to make this work, we would need to make enumarate_adapters async. |
Wumpf
left a comment
There was a problem hiding this comment.
I think biting the bullet and making enumerate_adapters async is the right call, not just because of the custom backend problem at hand but more so because it allows us to provide this also on WebGPU, elminating one of the weirder native/non-native distinctions. 👍
cc: @cwfitzgerald because this has been around for a long time and there might be repercussions I'm not thinking about right now
This being a breaking change that affects almost everyone, this should be mentioned prominently in the changelog.
|
Discussed at the wgpu maintainers meeting. Resolution: Lets make this async and compatible with the web. Discussion
|
76938ab to
867b1c6
Compare
cwfitzgerald
left a comment
There was a problem hiding this comment.
I didn't hit the button....
…fx-rs#8230) Co-authored-by: Andreas Reich <r_andreas2@web.de>
This is a working naga 28 update. I noticed some tests haven't passed (specifically cargo test --all-features) since before 0.14, so this PR doesn't attempt to make them pass. ## enumerate_adaptors `instance.enumerate_adapters` is async now (and available on webgpu): gfx-rs/wgpu#8230 . more details in the wgpu release notes. ## ControlBarrier & MemoryBarrier Barrier was split in two to support MemoryBarriers: gfx-rs/wgpu#7630 From the PR, it seems like falling back to ControlBarrier is fine so that's what I did. ## Ray Query enable ray queries require `enable wgpu_ray_query;`: gfx-rs/wgpu#8545 This doesn't currently seem to make it through, and the relevant test fails. ## ImageAtomic Image atomics were added in gfx-rs/wgpu#6706 ## Mesh Shaders Mesh shaders are a major feature of wgpu 28, ~~but I've set their fields to None here in the interest of doing an upgrade and not a feature add at the same time~~ https://github.com/gfx-rs/wgpu/releases/tag/v28.0.0 update: I found some time and built a wgpu mesh/task shader demo and used that to validate some of the mesh shader functionality. I've used this to successfully compile a task shader with naga-oil and run it, but there's still something missing from the mesh shader module output here. --------- Co-authored-by: robtfm <50659922+robtfm@users.noreply.github.com>
Description
When using a custom wgpu backend, you can't enumerate through the adapters to check compatibility because it checks if it is a Core Adapter. This change moves that code to the inner part of an Adapter so it can be a part of the AdapterInterface trait. This allows more functionality with custom backends.
Testing
Running all current tests
Squash
Commits will be squashed on merge
Checklist
cargo fmt.taplo format.cargo clippy --tests. If applicable, add:--target wasm32-unknown-unknowncargo xtask testto run tests.CHANGELOG.mdentry.